import Router from '@koa/router';
import * as categoryController from '../controllers/category.controller';
import { authMiddleware } from '../middleware/auth';

const router = new Router({
  prefix: '/api/categories',
});

// 所有路由都需要认证
router.use(authMiddleware);

// 创建分类
router.post('/create', categoryController.createCategory);

// 更新分类
router.post('/update', categoryController.updateCategory);

// 删除分类
router.post('/delete', categoryController.deleteCategory);

// 查询分类列表
router.post('/list', categoryController.getCategoryList);

// 查询分类详情
router.post('/detail', categoryController.getCategoryDetail);

export default router;

